package cn.fairy.fegin;

import cn.fairy.domian.Store;
import cn.fairy.utils.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ProductFallback implements FallbackFactory<ProductClient> {


    @Override
    public ProductClient create(Throwable throwable) {
        return new ProductClient() {
            @Override
            public AjaxResult add(Store store) {
                return new AjaxResult().setSuccess(false).setMessage("降级了");
            }
        };
    }
}
